Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add single pool handler #94

Merged
merged 9 commits into from
Oct 28, 2024
Merged

feat: add single pool handler #94

merged 9 commits into from
Oct 28, 2024

Conversation

agualis
Copy link
Collaborator

@agualis agualis commented Oct 22, 2024

Adds pool swap handler and extracts an new abstract class to share common logic.

TODO: Pool swaps in nested pools do not work cause underneath pool tokens are not valid in the swap route.

Copy link

vercel bot commented Oct 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mono-beets-v3 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 25, 2024 3:28pm
mono-frontend-v3 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 25, 2024 3:28pm
mono-test-v3 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 25, 2024 3:28pm

[swapState.tokenIn.address, swapState.tokenOut.address, swapState.selectedChain]
)
const handler = useMemo(() => {
if (isPoolSwap) resetSwapAmounts()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be here. The useMemo is about setting the swap handler and shouldn't contain other logic. If this side-effect is needed I guess it will have to go in a useEffect.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although, why is it needed only in the case of it being a pool swap?

@agualis agualis merged commit b138ec9 into main Oct 28, 2024
8 checks passed
@agualis agualis deleted the feat/singlePoolSwap branch October 28, 2024 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pool page swap UI
2 participants